﻿export default formData => {
  // 搜索栏配置
  const searchOption = ref({
    // labelWidth: "auto",
    menuPosition: "fixed",
    // searchExpand: true,
    formConfig: {
      // 商品编号
      id: {
        label: "商品编号",
        component: "el-input",
        componentProps: { placeholder: "请输入商品编号", clearable: true },
      },
      // 商品名称
      productName: {
        label: "商品名称",
        component: "el-input",
        componentProps: { placeholder: "请输入商品名称", clearable: true },
      },
      // 商品类目
      category: {
        label: "商品类目",
        component: "el-cascader",
        dicUrl: Api.product.getProductClassification,
        componentProps: { placeholder: "请选择商品类目", clearable: true },
      },
      // 租赁对象
      rentObject: {
        label: "租赁对象",
        component: "el-select",
        dicUrl: Api.common.getDictionaryData,
        dicQuery: { dictCode: "qingyun.product.rent.object.type" },
        dicProps: { label: "dictLabel", value: "dictValue" },
        componentProps: { placeholder: "请选择租赁对象", clearable: true },
      },
      // 商品类型
      productType: {
        label: "商品类型",
        component: "el-select",
        dicUrl: Api.common.getDictionaryData,
        dicQuery: { dictCode: "qingyun.product.product.type" },
        dicProps: { label: "dictLabel", value: "dictValue" },
        componentProps: { placeholder: "请选择商品类型", clearable: true },
      },
      // 租赁方案
      rentPlan: {
        label: "租赁方案",
        component: "el-select",
        dicUrl: Api.common.getDictionaryData,
        dicQuery: { dictCode: "qingyun.product.rent.plan" },
        dicProps: { label: "dictLabel", value: "dictValue" },
        componentProps: { placeholder: "请选择租赁方案", clearable: true },
      },
      // 商品渠道
      productChannel: {
        label: "商品渠道",
        component: "el-select",
        isCollapse: true,
        // dicUrl: Api.common.getDictionaryData,
        // dicQuery: { dictCode: "qingyun.product.rent.plan" },
        // dicProps: { label: "dictLabel", value: "dictValue" },
        componentProps: { placeholder: "请选择商品渠道", clearable: true },
      },
      // 新增时间
      addDate: {
        label: "新增时间",
        component: "el-date-picker",
        type: "daterange",
        valueFormat: "YYYY-MM-DD",
        isCollapse: true,
        componentProps: {
          type: "daterange",
          startPlaceholder: "开始日期",
          endPlaceholder: "结束日期",
          rangeSeparator: " ~ ",
          unlinkPanels: true,
          clearable: true,
        },
      },
      // 编辑时间
      editDate: {
        label: "编辑时间",
        component: "el-date-picker",
        type: "daterange",
        valueFormat: "YYYY-MM-DD",
        isCollapse: true,
        componentProps: {
          type: "daterange",
          startPlaceholder: "开始日期",
          endPlaceholder: "结束日期",
          rangeSeparator: " ~ ",
          unlinkPanels: true,
          clearable: true,
        },
      },
      // 操作人员
      operateName: {
        label: "操作人员",
        component: "el-input",
        isCollapse: true,
        componentProps: { placeholder: "请输入操作人员", clearable: true },
      },
    },
  });
  // 表格配置（去除所有 search* 配置）
  const tableOption = ref(
    Utils.tools.deleteSearchConfig({
      header: false, // 表头工具栏不要（按你图里 BaseCard 顶部控制）
      addBtn: false, // 列表不在表头新增
      editBtn: false, // 行内不出现“编辑/删除”按钮（操作区我们一般自定义）
      delBtn: false,
      border: false,
      menuWidth: 300, // 如需行内自定义操作区宽度可放开
      height: "auto",
      column: {
        // 商品信息
        id: {
          label: "商品信息",
          minWidth: 400,
          slot: true,
        },
        // 商品类目
        category: {
          label: "商品类目",
          width: 300,
          slot: true,
        },
        // 租赁对象
        rentObject: {
          label: "租赁对象",
          width: 200,
          slot: true,
        },
        // 租赁方案
        rentPlanStr: {
          label: "渠道方案",
          width: 300,
          slot: true,
        },
        // 适用渠道
        channelTypeStr: {
          label: "适用渠道",
          width: 500,
        },
        // 商品配件
        productComponentFlagDesc: {
          label: "商品配件",
          width: 120,
          slot: true,
        },
        // // 平台佣金
        // rentPercent: {
        //   label: "平台佣金",
        //   width: 200,
        //   slot: true,
        // },
        // // 商品数量
        // productNum: {
        //   label: "商品数量",
        //   width: 200,
        // },
        // 新增时间
        createTime: {
          label: "新增时间",
          type: "datetime",
          format: "YYYY-MM-DD HH:mm:ss",
          valueFormat: "YYYY-MM-DD HH:mm:ss",
          // minWidth: 180,
          width: 300,
        },
        // 更新时间
        updateTime: {
          label: "编辑时间",
          type: "datetime",
          format: "YYYY-MM-DD HH:mm:ss",
          valueFormat: "YYYY-MM-DD HH:mm:ss",
          // minWidth: 180,
          width: 300,
        },
        // 操作人
        operateName: {
          label: "操作人",
          width: 200,
        },
      },
    })
  );
  return { searchOption, tableOption };
};
